package com.system.employee.entity.dto;

import java.util.Date;

import com.system.common.util.Sex;
import com.system.employee.entity.Employee;
import com.system.user.entity.User;



public class EmployeeUserDTO {
	private Long id;
	private Long empId;
	private Long partId;
	private String empName;
	private Sex sex;
	private Date birthday;
	private String bornPlace;//出生地
	private String address;//住址
	private String email;
	private String phone;
	private String education;//学历
	private String political;//政治面貌
	private String ethnic;//民族
	private String idcard;//身份证
	private String idcardImg;//头像地址
	private String userName;
	private String password;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public Long getEmpId() {
		return empId;
	}

	public void setEmpId(Long empId) {
		this.empId = empId;
	}

	public Long getPartId() {
		return partId;
	}

	public void setPartId(Long partId) {
		this.partId = partId;
	}

	public String getEmpName() {
		return empName;
	}

	public void setEmpName(String empName) {
		this.empName = empName;
	}

	public Sex getSex() {
		return sex;
	}
	
	public void setSex(Sex sex) {
		this.sex = sex;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getBornPlace() {
		return bornPlace;
	}

	public void setBornPlace(String bornPlace) {
		this.bornPlace = bornPlace;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	public String getPolitical() {
		return political;
	}

	public void setPolitical(String political) {
		this.political = political;
	}

	public String getEthnic() {
		return ethnic;
	}

	public void setEthnic(String ethnic) {
		this.ethnic = ethnic;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	public String getIdcardImg() {
		return idcardImg;
	}

	public void setIdcardImg(String idcardImg) {
		this.idcardImg = idcardImg;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public static Employee getAddEmployeeUser(EmployeeUserDTO employeeUserDTO) {
		Employee employee = new Employee();
		User user = new User();
		user.setUserName(employeeUserDTO.getUserName());
		user.setPassword(employeeUserDTO.getPassword());
		employee.setAddress(employeeUserDTO.getAddress());
		employee.setBirthday(employeeUserDTO.getBirthday());
		employee.setBornPlace(employeeUserDTO.getBornPlace());
		employee.setEducation(employeeUserDTO.getEducation());
		employee.setEmail(employeeUserDTO.getEmail());
		employee.setEmpId(employeeUserDTO.getEmpId());
		employee.setEthnic(employeeUserDTO.getEthnic());
		employee.setEmpName(employeeUserDTO.getEmpName());
		employee.setIdcard(employeeUserDTO.getIdcard());
		employee.setIdcardImg(employeeUserDTO.getIdcard());
		employee.setPhone(employeeUserDTO.getPhone());
		employee.setPolitical(employeeUserDTO.getPolitical());
		employee.setSex(employeeUserDTO.getSex());
		employee.setUser(user);
		return employee;
		
	}
	public static Employee getEditEmployeeUser(EmployeeUserDTO employeeUserDTO) {
		Employee employee = new Employee();
		employee.setAddress(employeeUserDTO.getAddress());
		employee.setBirthday(employeeUserDTO.getBirthday());
		employee.setBornPlace(employeeUserDTO.getBornPlace());
		employee.setEducation(employeeUserDTO.getEducation());
		employee.setEmail(employeeUserDTO.getEmail());
		employee.setEmpId(employeeUserDTO.getEmpId());
		employee.setEthnic(employeeUserDTO.getEthnic());
		employee.setEmpName(employeeUserDTO.getEmpName());
		employee.setIdcard(employeeUserDTO.getIdcard());
		employee.setIdcardImg(employeeUserDTO.getIdcard());
		employee.setPhone(employeeUserDTO.getPhone());
		employee.setPolitical(employeeUserDTO.getPolitical());
		employee.setSex(employeeUserDTO.getSex());
		return employee;
		
	}
}
